package cn.dkk.structure_design.facade;


import cn.dkk.structure_design.facade.pojo.AirConditioner;
import cn.dkk.structure_design.facade.pojo.TV;

import java.time.Year;

/**
 * @author dkk
 * @date 2022/7/11
 * @desc
 */
public class ApplicationFacade {

    private TV tv;

    private AirConditioner airConditioner;

    public ApplicationFacade(TV tv, AirConditioner airConditioner) {
        this.tv = tv;
        this.airConditioner = airConditioner;
    }

    public void sswitch(boolean sswitch){
        if (sswitch){
            on(sswitch);
        }
        else{
            off(sswitch);
        }
    }

    public void off(boolean sswitch){
        tv.off(sswitch);
        airConditioner.off(sswitch);
    }

    public void on(boolean sswitch){
        tv.on(sswitch);
        airConditioner.on(sswitch);
    }


}
